package com.taobao.taobaowidget.test;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.ArrayAdapter;
import android.widget.ListView;

public class MainActivity extends Activity {

    ListView mListView;
    
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        mListView = new ListView(this);
        String [] str = {"PopupSpinner", "TabBarView", "ExpandableTextView"/*, "CategoryExpandableListView"*/};
        mListView.setAdapter(new ArrayAdapter(this, android.R.layout.simple_list_item_1, str));
        setContentView(mListView);
        mListView.setOnItemClickListener(new OnItemClickListener(){

            @Override
            public void onItemClick(AdapterView<?> arg0, View arg1, int pos, long arg3) {
                // TODO Auto-generated method stub
                switch(pos){
                    case 0:
                        startActivity(new Intent(MainActivity.this, PopupSpinnerActivity.class));
                        break;
                    case 1:
                        startActivity(new Intent(MainActivity.this, TabBarActivity.class));
                        break;
                    case 2:
                        startActivity(new Intent(MainActivity.this, ExpandableTextViewActivity.class));
                        break;
//                    case 3:
//                    	startActivity(new Intent(MainActivity.this, CategoryExpandableListViewActivity.class));
                }
            }
            
        });

    }    
}
